package org.yohann.ai.controller;

import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.yohann.ai.service.ReplyService;

import java.util.Map;

@RestController
@CrossOrigin("*")
@AllArgsConstructor
@RequestMapping("/email")
public class ReplyController {

    private final ReplyService service;

    @PostMapping
    public String receive(@RequestBody Map<String, String> body) {
        return service.replyEmail(body.get("email"), body.get("content"));
    }

}